/*
 * Copyright 2016 Wealth Inc. All rights reserved.
 */
 package com.wealth.member.service;

import iaas.service.IBaseService;
import iaas.utils.ResultObject;

import java.util.List;
import java.util.Map;

import org.hibernate.service.spi.ServiceException;
import org.springframework.data.domain.Page;

import com.wealth.member.entity.Address;

/**
 * @author chan
 */
 public interface IAddressService extends IBaseService<Address>{
	

	public List<Address> getByCorpIdAndStatus(Long corpid,Integer status) throws Exception;
	
	/**  ---------------- 微信端  ---------------- */
	/** 查询 会员+状态不等于 */
	public List<Address> getAddressByMemberIdAndStatusNot(Long memberid,Integer status) throws Exception;
	/** 查询 会员+默认  */
	public Address getAddressDefault(Long memberid);
	//查询是否是第一创建收货地址
	public List<Address> findByMemberId(Long memberid);
	
	/**
	 * 分页查询, 前台pagination
	 */
	public Page<Address> getAddress(Long memberid, Map<String, Object> searchParams, int pageNumber, int pageSize,
			String sortType,String sortDirection) throws ServiceException;
	
	/**
	 * 查询 全部
	 */
	public List<Address> getAllAddress() throws ServiceException;
	
	/**
	 * 查询 单一
	 */
	public Address getAddress(Long id) throws ServiceException;
	
	/**
	 * 创建
	 */
	public void saveAddress(Address address) throws ServiceException;
	
	/**
	 * 编辑
	 */
	public void updateAddress(Address address) throws ServiceException;
	
	/**
	 * 删除
	 */
	public void deleteAddress(Long id) throws ServiceException;
	
	public ResultObject  getAddressPage(Long memberid,Integer pageSize,Integer pageNumber) throws Exception;
	
//	//设置之前默认为普通地址
//	public void setDefaultAsNormal(Address address);
//	//删除地址
//	public void deleteAddress(Long id) ;
}

